<!doctype html>
<html lang="en" class="fixed">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>修改密码</title>
    <!-- <link type="text/css" rel="stylesheet" href="../../topjui/plugins/layui/css/layui.css"> -->
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/layui/css/layui.css')) ?>" media="all">
    <link rel="stylesheet" type="text/css"
          href="<?php xcho(loadSource('/assets/plugins/bootstrap/css/bootstrap.min.css')) ?>">
    <link rel="stylesheet" type="text/css"
          href="<?php xcho(loadSource('/assets/plugins/bootstrap/css/bootstrap-datetimepicker.min.css')) ?>">
    <link rel="stylesheet" type="text/css"
          href="<?php xcho(loadSource('/assets/plugins/bootstrap/css/build_standalone.css')) ?>">
    <link rel="stylesheet" type="text/css" href="<?php xcho(loadSource('/assets/plugins/bootstrap/css/build.css')) ?>">
    <!-- TopJUI框架样式 -->
    <link type="text/css" href="<?php xcho(loadSource('/assets/css/topjui.core.min.css')) ?>" rel="stylesheet">
    <link type="text/css" href="<?php xcho(loadSource('/assets/themes/default/topjui.purplelight.css')) ?>" rel="stylesheet" id="dynamicTheme"/>
    <!-- FontAwesome字体图标 -->
    <link type="text/css" href="<?php xcho(loadSource('/assets/plugins/font-awesome/css/font-awesome.min.css')) ?>" rel="stylesheet"/>
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/ztree/css/zTreeStyle/zTreeStyle.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/css/new_main.css')) ?>">
</head>
<body>
    <?php include_once TPL_PATH . 'public/nav.phtml'; ?>
<div class="wrap">
    <div class="page-body full-wrap" style="padding: 0">
        <div class="class-box">
            <div class="class-box-head ">
                <div class="class-box-title">
                    <h3 class="col-md-11">
                        修改密码
                    </h3>
                    <div class="col-md-1">
                        <a href="/">返回首页</a>
                    </div>
                </div>
            </div>
            <div class="class-box-body">
                
                <div class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-1 control-label" for="">原始密码</label>
                        <div class="col-sm-11">
                            <input  name="password" class="form-control" value="" type="password"/>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-sm-1 control-label" for="">新 密码</label>
                        <div class="col-sm-11">
                            <input  name="new_password" class="form-control" value="" type="password"/>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-sm-1 control-label" for="">确认密码</label>
                        <div class="col-sm-11">
                            <input   name="confirm_password" class="form-control" value="" type="password"/>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6 btns-group" style="width: 40%">
                    <button class="btn btn-primary editpwd">提交修改</button> 
                </div>
            </div>
        </div>
    </div>  
</div>
<input type="hidden" name="editpwd" value="<?php xcho($editpwd) ?>" />
<input type="hidden" name="user_id" value="<?php xcho($user_id) ?>" />
<input type="hidden" name="logout" value="<?php xcho($logout) ?>" />
<script src="<?php xcho(loadSource('/assets/plugins/jquery/jquery.min.js')) ?>"></script>
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery
/jquery-1.4.min.js"></script>
<script>
    $(function () {
        $(".editpwd").click(function () {
            var url=$("input[name='editpwd']").val();
            var uid=$("input[name='user_id']").val();
            var password=$("input[name='password']").val();
            var new_password=$("input[name='new_password']").val();
            var confirm_password=$("input[name='confirm_password']").val();
            var new_url=$("input[name='logout']").val();
            $.ajax({
                url:url,
                type:'post',
                dataType:'json',
                data:{user_id:uid,password:password,new_password:new_password,confirm_password:confirm_password},
                success:function (resp) {
                    if(resp.success==1){
                        alert('修改成功');
//                        window.close();
//                        parent.location.reload()
                        window.location.href=new_url;
                    }else {
                        alert('修改失败');
                    }
                }
            })
        })

    })
</script>
</body>
</html>